package com.itspeedster.betterforeyes;

import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

@SuppressWarnings("serial")
public class AppPopupMenu extends PopupMenu{

	public AppPopupMenu(){
		MenuItem itAbout 	= new MenuItem("Giới thiệu");
		MenuItem itSetting 	= new MenuItem("Cài đăt");
		MenuItem itExit 	= new MenuItem("Thoát");
		
		add(itAbout);
			addSeparator();
		add(itSetting);
			addSeparator();
		add(itExit);
		
		itExit.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				System.exit(0);
			}
		});
        itAbout.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				JOptionPane.showMessageDialog(null, "Phần mềm bảo vệ mắt, phát triển bởi kngochai");
			}
		});
        itSetting.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				new SettingView().setVisible(true);
			}
		});
	}
}
